var DateUtil = {
	isData:function(val){
		return (val
			&& val.length==10);
			
	},
	format:function(date){
		if(!date) return "";
		var str = "";
		str = date.getFullYear()+"-";
		var month = date.getMonth()+1;
		if(month<10)
			str= str+"0";
		str +=month;
		str= str+"-";
		var day = date.getDate();
		if(day<10){
			str= str+"0";
		}
		str +=day;
		return str;
	},
	formatFullDate:function(date){
		var str = DateUtil.format(date);
		str = str+" ";
		str = str + DateUtil.formatNum(date.getHours());
		str = str+":";
		str = str + DateUtil.formatNum(date.getMinutes());
		str = str+":";
		str = str + DateUtil.formatNum(date.getSeconds());
		return str;
	},
	
	getMonth:function(dateStr){
		if(!DateUtil.isData(dateStr))
			return null;
		var monthStr = dateStr.substring(5,7);
		if(monthStr.substring(0,1)=='0')
			return parseInt(monthStr.substring(1,2));
		else
			return parseInt(monthStr);
	},
	formatNum:function(num){
		var num = parseInt(num);
		if(num<10) return "0"+num;
		return num;
	}
	
}